<%-- 
    Document   : FormKonfirmasiPengiriman
    Created on : Nov 20, 2013, 8:56:54 AM
    Author     : agung
--%>

<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Form Konfirmasi Pengiriman</title>
        <link href="css/screen.css" rel="stylesheet" type="text/css"/>

    </head>
    <body>
        <div id="container"><center><img src="gambar/handshaking.jpg" width="1350" height="300">
          
                <% session = request.getSession(false);
                    String n = (String) session.getAttribute("uname");
                    if (n != null) {
                        out.print("Anda login sebagai " + n);
                    } else {
                        out.print("Session belum ada");
                    }
                %> 
            <div id="navigation">
                <ul>
                    <li><a href="HomeAdmin.jsp">Home</a></li>
                    <li><a href="FormTerimaBarang.jsp">Terima Barang</a></li>
                    <li><a href="FormLihatBarang.jsp">Lihat Barang</a></li>
                    <li><a href="FormKirimBarang.jsp">Kirim Barang</a></li>
                    <li><a href="FormKonfirmasiPengiriman.jsp">Konfirmasi Pengiriman</a></li>
                    <li><a href="Logout.jsp">Logout</a></li>
                </ul>
            </div>
            <div id="content">
<%
                    try {
                        Connection con = KoneksiDB.Koneksi.open();
                        Statement stat = con.createStatement();
                        String cek = "select * from pemesanan where status = 'sedang dikirim'";
                        ResultSet res = stat.executeQuery(cek);
                %>
                <table border="1">
                    <tr  width="10" bgcolor="#94A985">
                        <td>Tanggal Pesan</td>
                        <td>Kode Pemesanan</td>
                        <td>Cabang Indomaret</td>
                        <td>Nama Barang</td>
                        <td>Jumlah</td>
                        <td>Status</td>
                    </tr>
                    <%
                        while (res.next()) {
                    %>
                    <tr>
                        <td><%=res.getString("tanggal_pesan")%></td>
                        <td><%=res.getString("kode_pemesanan")%></td>
                        <td><%=res.getString("cabang_indomaret")%></td>
                        <td><%=res.getString("nama_barang")%></td>
                        <td><%=res.getString("jumlah_barang")%></td>
                        <td><%=res.getString("status")%></td>
                    </tr>
                    <%   }%>
                </table>
                <%
                        res.close();
                        stat.close();
                        con.close();
                    } catch (Exception ex) {
                        out.println("Can't connect to database.");
                    }%>

                <form id="FKirimBarang" name="FKirimBarang" action="KirimBarangController" onsubmit="return validateForm();"> 
                    <h1>Konfirmasi Pengiriman</h1>   
                    <label>Kode Pemesanan </label> : <input name="kodePemesanan" type="text" id="kodePemesanan" size="20" maxlength="20" class="txt" /><br/><br/>
                    <label>Status </label> : <input name="status" type="text" id="status" size="20" maxlength="20" class="txt" /><br/><br/>
                    <div id="tombol">
                        <input name="btnSimpan" type="submit" value="Simpan" class="button" />
                        <input name="btnReset" type="reset" value="Reset" class="button" />
                    </div> 
                </form> 

            </div>
            <div id="footer">
                Copyright © Sistem Informasi Distributor Indomaret, 2013
            </div>
        </div>
    </body>
</html>
